//
//  CYGDetailRcmdPicCell.m
//  CYGHuntForCity
//
//  Created by cygarm on 16/3/26.
//  Copyright © 2016年 cygarm. All rights reserved.
//

#import "CYGDetailRcmdPicCell.h"
#import <UIImageView+WebCache.h>

@interface CYGDetailRcmdPicCell ()

@property (weak, nonatomic) IBOutlet UIImageView *picImgView;

@end

@implementation CYGDetailRcmdPicCell

- (void)awakeFromNib {
    // Initialization code
	self.selectionStyle = UITableViewCellSelectionStyleNone;
}

+ (instancetype)cellWithTableView:(UITableView *)tableView model:(CYGDetailRcmdCellModel *)model {
	static NSString *cellID = @"idDetailRcmdPicCell";
	CYGDetailRcmdPicCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
	if (cell == nil) {
		cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
	}
	
	cell.model = model;
	return cell;
}

- (void)setModel:(CYGDetailRcmdCellModel *)model {
	_model = model;
	[self.picImgView sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:[UIImage imageNamed:@"cover_headerView"]];
	model.cellHeight = 348;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
